package 链表;

public class LinkedListUtils {
    /**
     * 打印整个链表
     * @param head 头节点
     */
    public static void printNode(ListNode head) {
        StringBuilder str = new StringBuilder();
        str.append(head.val);
        while (head.next != null) {
            head = head.next;
            str.append("," + head.val);
        }
        System.out.println("str:" + str.toString());
    }
}
